# Cross compiler
CROSS_COMPILE=arm-linux-gnueabihf-
CC=${CROSS_COMPILE}gcc
AR=${CROSS_COMPILE}ar

# libgpiod compile install path
LIBGPIOD_PATH=libgpiod/install/

# compile flags and link flags
CFLAGS+=-I${LIBGPIOD_PATH}/include
LDFLAGS+=-L${LIBGPIOD_PATH}/lib -lgpiod

all:
	${CC} ${CFLAGS} leds.c 		-o leds 	${LDFLAGS}
	${CC} ${CFLAGS} keypad.c 	-o keypad 	${LDFLAGS}
	${CC} ${CFLAGS} ds18b20.c 	-o ds18b20 	${LDFLAGS}
	${CC} ${CFLAGS} pwm.c 		-o pwm  	${LDFLAGS}
	${CC} ${CFLAGS} pwm_play.c 		-o pwm_play  	${LDFLAGS}
clean:
	@rm -f leds
	@rm -f keypad
	@rm -f ds18b20
	@rm -f pwm
	@rm -f pwm_play